import http from '@/api/request';

// 获取用户地址列表
export const getAddressList = () => {
  return http.request({
    method: 'GET',
    url: '/app/address/list',
  });
};

// 获取用户地址
export const getAddress = (id: number) => {
  return http.request({
    method: 'GET',
    url: '/app/address/detail',
    params: { id: id },
  });
};

// 编辑用户地址
export const addAddress = (form: object) => {
  return http.request({
    method: 'POST',
    url: '/app/address/create',
    data: form,
  });
};

// 编辑用户地址
export const setAddress = (form: object) => {
  return http.request({
    method: 'POST',
    url: '/app/address/update',
    data: form,
  });
};

// 编辑用户地址
export const delAddress = (id: number) => {
  return http.request({
    method: 'POST',
    url: '/app/address/delete',
    data: { id: id },
  });
};
